﻿<UserControl x:Class="Sakura.Games.StgFramework.Builder.UI.DamageTypeEditPage"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
			xmlns:my="clr-namespace:Sakura.Games.StgFramework.Builder.UI"
			xmlns:shell="clr-namespace:Microsoft.WindowsAPICodePack.Shell;assembly=Microsoft.WindowsAPICodePack.Shell"
      mc:Ignorable="d" 
      d:DesignHeight="480" d:DesignWidth="640">

	<Grid>
		<Grid.RowDefinitions>
			<RowDefinition Height="auto" />
			<RowDefinition />
			<RowDefinition Height="auto" />
		</Grid.RowDefinitions>
		
		<Grid Name="TipGrid" Grid.Row="0" Margin="10">
			<Grid.ColumnDefinitions>
				<ColumnDefinition Width="auto" />
				<ColumnDefinition />
			</Grid.ColumnDefinitions>
			
			<Image Margin="3" Grid.Column="0" Height="32" Width="32" Source="{Binding Path=BitmapSource, Source={StaticResource WarningIcon}}" />
			
			<TextBlock Margin="3" Grid.Column="1" TextWrapping="Wrap" Text="伤害类型列表影响到所有种族、职业、角色的伤害修正表，以及所有道具、武器、技能效果的伤害设定。如果您修改了此页面，请注意修改相关页面的设定参数。" />
			
		</Grid>
		
		<ListBox Grid.Row="1" Name="MainListBox" HorizontalContentAlignment="Stretch" ItemsSource="{Binding Path=Items, RelativeSource={RelativeSource FindAncestor, AncestorType=my:DamageTypeEditPage}}" SelectionMode="Extended">
			<ListBox.ItemTemplate>
				<DataTemplate>
					<my:DamageTypeItemEditor DataItem="{Binding}" />
				</DataTemplate>
			</ListBox.ItemTemplate>
			<ListBox.InputBindings>
				<KeyBinding Key="Delete" Command="my:ActionCommands.Delete" />
			</ListBox.InputBindings>
		</ListBox>
		
		<StackPanel Name="CommandPane" Grid.Row="2" Orientation="Horizontal">
			<Button Margin="3" Style="{StaticResource ImageItemButtonStyle}" Content="{StaticResource AddItem}" Command="my:ActionCommands.Add" />
			<Button Margin="3" Style="{StaticResource ImageItemButtonStyle}" Content="{StaticResource DeleteItem}" Command="my:ActionCommands.Delete" />
		</StackPanel>
		
	</Grid>
	
	<UserControl.CommandBindings>
		<CommandBinding Command="my:ActionCommands.Add" CanExecute="OnAddCanExecute" Executed="OnAddExecuted" />
		<CommandBinding Command="my:ActionCommands.Delete" CanExecute="OnDeleteCanExecute" Executed="OnDeleteExecuted" />
		<CommandBinding Command="my:ActionCommands.Edit" CanExecute="OnEditCanExecute" Executed="OnEditExecuted" />
	</UserControl.CommandBindings>
	
</UserControl>
